<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10_局部组件</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id=app>
        <son></son>
        <son></son>
    </div>
<template id="tmp">
    <button @click="count++">
        你点了我{{count}}次
    </button>
</template>

    <script>
        const com1 = {
                    template: '#tmp',
                    data(){
                        return {
                            count: 0
                        };
                    }
                };

        const vm = new Vue({
            el:'#app',
            components:{
                son: com1
            }
            
        });
    </script>
</body>
</html>